home *** CD-ROM | disk | FTP | other *** search
- foodLevel = 50;
- foodRythme = 0.03;
- exerciceLevel = 75;
- exerciceRythme = 0.02;
- careLevel = 60;
- careRythme = 0.04;
- Wellness = (careLevel + foodLevel + ExerciceLevel) / 3;
- TheEnd = flase;
- animStack = new Array();
- scoreStats = new Array();
- animCount = 0;
- animPlay = false;
- animCount = animStack.push("Idle");
- AnimHappyAvailable = true;
- AnimDepress01Available = true;
- AnimDepress02Available = true;
- AnimHungryAvailable = true;
- countTimeLiter = false;
- initTime = getTimer();
- _root.onEnterFrame = function()
- {
- foodLevel -= foodRythme;
- exerciceLevel -= exerciceRythme;
- careLevel -= careRythme;
- Wellness = (careLevel + foodLevel + ExerciceLevel) / 3;
- if(animPlay == false and animStack.length > 0)
- {
- tempAnimName = animStack.pop();
- trace("Joue: " + tempAnimName);
- Cat.gotoAndPlay(tempAnimName);
- animPlay = true;
- }
- if(Wellness > 80 and AnimHappyAvailable == true)
- {
- if(random(100) == 10)
- {
- animCount = animStack.push("Happy");
- AnimHappyAvailable = false;
- }
- }
- if(Wellness > 30 and Wellness < 50 and AnimDepress01Available == true)
- {
- if(random(100) == 10)
- {
- animCount = animStack.push("Depress01");
- AnimDepress01Available = false;
- }
- }
- if(Wellness < 30 and Wellness > 10 and AnimDepress02Available == true)
- {
- if(random(100) == 10)
- {
- animCount = animStack.push("Depress02");
- AnimDepress02Available = false;
- }
- }
- if(Wellness < 1)
- {
- TheEnd = true;
- animCount = animStack.push("WalkAway");
- }
- if(foodLevel < 30 and AnimHungryAvailable == true)
- {
- if(random(100) == 10)
- {
- animCount = animStack.push("Hungry");
- AnimHungryAvailable = false;
- }
- }
- if(random(2000) == 50)
- {
- animCount = animStack.push("Toilette");
- countTimeLiter = true;
- }
- if(countTimeLiter == true)
- {
- CountMaskTime++;
- if(CountMaskTime == 500)
- {
- animCount = animStack.push("Mask");
- CountMask = 0;
- }
- }
- actualTime = getTimer();
- if(actualTime - initTime >= 30000)
- {
- trace("UNE MINUTE!");
- TimeLine.nextFrame();
- initTime = getTimer();
- scoreCount = scoreStats.push(Wellness);
- }
- if(foodLevel - exerciceLevel > 20 and foodLevel - exerciceLevel < 40)
- {
- Cat.Bid.gotoAndStop("Normal");
- Cat.Cou.gotoAndStop("Normal");
- }
- if(foodLevel < 20)
- {
- Cat.Bid.gotoAndStop("Small");
- Cat.Cou.gotoAndStop("Small");
- }
- if(foodLevel - exerciceLevel > 40)
- {
- Cat.Bid.gotoAndStop("Medium");
- Cat.Cou.gotoAndStop("Madium");
- }
- if(foodLevel > 100)
- {
- exerciceLevel -= 10;
- foodLevel = 100;
- }
- if(careLevel > 100)
- {
- exerciceLevel -= 10;
- careLevel = 100;
- }
- if(exerciceLevel > 100)
- {
- foodLevel -= 10;
- exerciceLevel = 100;
- }
- };
- calculateScore = function()
- {
- if(TheEnd != true)
- {
- i = 0;
- while(i < 10)
- {
- Total += scoreStats[i];
- i++;
- }
- Moy = Total / 10;
- trace("GameOVER. Your score is : " + Moy);
- _root.Score = String(Math.round(Moy * 100) / 100) + " %";
- _root.gotoAndStop("GameOverWin");
- }
- };
-